﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Yuekao.API.Write.Command;
using Yuekao.Domain.API;

namespace Yuekao.API.Write.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ManageController : ControllerBase
    {
        private readonly IMediator mediator;

        public ManageController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 医生管理删除
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPut]
        public async Task<APIResult<bool>> DelDoctor(DelDoctorCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 服务审批
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPut]
        public async Task<APIResult<bool>> ServiceShen(UpdServiceCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 医生审批
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPut]
        public async Task<APIPagging<bool>> AuditStatusShen(UpdAuditCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
